package com.example.demo.设计模式.代理模式.CGLIB代理;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

public class ProxyHandler implements MethodInterceptor {

    @Override
    public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
        System.out.println("before do ...");
        Object object = methodProxy.invokeSuper(o, objects);
        System.out.println("after do ...");
        return object;
    }
}
